#include <iostream>
/*vh=1/12*vm
 * vm=1/60*vs;
 * vs=6 d/s
 *
 * xs=6*t(0<t<60)
 * xm=0.1*t+xm0(0<t<60)
 * xh=0.1/12*t+xh0(0<t<60)
 */
inline void reset(double &d)
{
    if(d<0)
        d=0;
    if(d>60)
        d=60;
}
struct Interval{
    double l,r;
    friend std::ostream& operator <<(std::ostream& ostr, const Interval& i)
    {
        ostr<<"("<<i.l<<","<<i.r<<")";
        return ostr;
    }
};

void getsm(double xm0, double dur, double &min1, double &max1, double &min2, double &max2)
{
    /* dur<xs-xm<360-dur-->dur+xm0<5.9t<360-dur+xm0
     * dur-360<xs-xm<-dur
     */
    min1 = (-dur+xm0)/5.9;max1=(dur+xm0)/5.9;
    reset(min1);reset(max1);
    dur=360-dur;
    min2 = (-dur+xm0)/5.9;max2=(dur+xm0)/5.9;
    reset(min2);reset(max2);

}
void getsh(double xh0, double dur, double &min1, double &max1, double &min2, double &max2)
{
    /*(0, (-d+h0)/(6-1/120))U((d+h0)/(6-1/120), 60 )
     *
     */
    min1 = (-dur+xh0)/(6-1/120.0);max1=(dur+xh0)/(6-1/120.0);
    reset(min1);reset(max1);
    dur=360-dur;
    min2 = (-dur+xh0)/(6-1/120.0);max2=(dur+xh0)/(6-1/120.0);
    reset(min2);reset(max2);
}
void getmh(double xh0, double xm0, double dur, double &min1, double &max1,double &min2, double &max2)
{
    min1 = (-dur+xh0-xm0)/(1.1/12.0);max1=(dur+xh0-xm0)/(1.1/12.0);
    reset(min1);reset(max1);
    dur=360-dur;
    min2 = (-dur+xh0-xm0)/(1.1/12.0);max2=(dur+xh0-xm0)/(1.1/12.0);
    reset(min2);reset(max2);
}
Interval interSect(Interval A, Interval B)
{
    double l,r;
    l=A.l>B.l?A.l:B.l;
    r=A.r>B.r?B.r:A.r;
    if(l>r)
        l=r=0;
    return Interval{l,r};
}
double getInterSection(Interval *A, Interval *B, Interval *C)
{
    double sum=0;
    for(int i = 0; i<2; i++)
    {
        for(int j=0; j<2; j++)
        {
            for(int k=0; k<2; k++)
            {
                Interval t = interSect(A[i], B[j]);
                t = interSect(t, C[k]);
                sum+=t.r-t.l;
            }
        }
    }
    return sum;
}
double f(double dur)
{
    double sum=0.0;
    for(int i=0; i<60*12; i++)
    {
        double xm0 = (6*i)%360;
        double xh0 = 0.5*i;
        Interval A[2],B[2],C[2];
        getsm(xm0, dur, A[0].r, A[1].l, A[0].l, A[1].r);
        getsh(xh0, dur, B[0].r, B[1].l, B[0].l, B[1].r);
        getmh(xh0, xm0, dur, C[0].r, C[1].l, C[0].l, C[1].r);
        sum+=getInterSection(A,B,C);


    }
    return sum;
}
int main(int argc, char *argv[])
{
    double dur;
    while (1) {
        std::cin>>dur;
        if(dur<0)
            break;
        if(dur>120.0)
            printf("%.3lf\n", 0);
        else
            printf("%.3lf\n", f(dur)/3600.0/12.0*100.0);
    }
    return 0;
}
